<?php
/**
 * CreateUser: zlh
 * CreateTime: 2022/4/12 17:02
 * Remark:
 */

namespace App\Enum\ApprovalEnum;

use App\Enum\BaseEnumInterface;

class ApprovalEnums implements BaseEnumInterface
{
    // 默认 单个审批
    const APPROVAL_TYPE_NONE = 1;
    // 会签
    const APPROVAL_TYPE_AND = 2;
    // 或签
    const APPROVAL_TYPE_OR = 3;

    public static function getEnumMeaningByEnumCode($enumCode)
    {
        switch ($enumCode){
            case self::APPROVAL_TYPE_NONE:
                return "NONE";
            case self::APPROVAL_TYPE_AND:
                return "AND";
            case self::APPROVAL_TYPE_OR:
                return "OR";
        }
    }


    /**
     * 映射返回名字
     * @param $result
     * @return string
     */
    public static function getResultName($result)
    {
        switch ($result){
            case "agree":
                return "同意";
            case "refuse":
                return "拒绝";
            case "redirect":
                return "转交";
            default:
                return "未知操作";
        }

    }
}